package java_class_work.week05;

import java.io.File;

public class FileOperator {
    public static void main(String[] args) {
        // 返回根目录下 所有文件
        File file = new File(File.separator);
        String[] list = file.list();
        for (int i = 0; i < list.length; i++) {
            String s = list[i];
            System.out.println(s);
        }

        File[] files = file.listFiles();
        for (int i = 0; i < files.length; i++) {
            File file1 = files[i];
            System.out.println(file1.getName());
        }
    }
}
